.class public Lcom/glympse/platform/ProviderSkyhook;
.super Ljava/lang/Object;
.source "ProviderSkyhook.java"

# interfaces
.implements Lcom/skyhookwireless/wps/WPSPeriodicLocationCallback;
.implements Lcom/glympse/platform/common/GlympseListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/glympse/platform/ProviderSkyhook$MyRegistrationCallback;,
        Lcom/glympse/platform/ProviderSkyhook$MyTilingListener;,
        Lcom/glympse/platform/ProviderSkyhook$PostAccountCreationToMainThread;
    }
.end annotation


# static fields
.field protected static final ACCOUNT:Ljava/lang/String; = "Glympsereg"

.field protected static final REALM:Ljava/lang/String; = "Glympse"

.field public static SKYHOOK_SUPPORTED:Z


# instance fields
.field protected m_fGetPeriodicLocationError:Z

.field protected m_fGlympseListener:Z

.field protected m_fRunning:Z

.field protected m_oWPS:Lcom/skyhookwireless/wps/XPS;

.field protected m_oWPSAuthentication:Lcom/skyhookwireless/wps/WPSAuthentication;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 56
    const/4 v0, 0x1

    sput-boolean v0, Lcom/glympse/platform/ProviderSkyhook;->SKYHOOK_SUPPORTED:Z

    .line 54
    return-void
.end method

.method public constructor <init>()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    const/4 v0, 0x0

    .line 54
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 61
    iput-boolean v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fRunning:Z

    .line 62
    iput-boolean v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fGlympseListener:Z

    .line 64
    iput-object v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPS:Lcom/skyhookwireless/wps/XPS;

    .line 65
    iput-object v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPSAuthentication:Lcom/skyhookwireless/wps/WPSAuthentication;

    .line 66
    iput-boolean v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fGetPeriodicLocationError:Z

    .line 54
    return-void
.end method

.method private Start2_CreateAccount(Ljava/lang/String;)V
    .locals 5
    .parameter "strName"

    .prologue
    .line 122
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "ProviderSkyhook.Start2_CreateAccount("

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ")"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 126
    :try_start_0
    new-instance v1, Lcom/skyhookwireless/wps/WPSAuthentication;

    const-string v2, "Glympse"

    invoke-direct {v1, p1, v2}, Lcom/skyhookwireless/wps/WPSAuthentication;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    iput-object v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPSAuthentication:Lcom/skyhookwireless/wps/WPSAuthentication;

    .line 128
    iget-object v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPS:Lcom/skyhookwireless/wps/XPS;

    .line 129
    new-instance v2, Lcom/skyhookwireless/wps/WPSAuthentication;

    const-string v3, "Glympsereg"

    const-string v4, "Glympse"

    invoke-direct {v2, v3, v4}, Lcom/skyhookwireless/wps/WPSAuthentication;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 130
    iget-object v3, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPSAuthentication:Lcom/skyhookwireless/wps/WPSAuthentication;

    .line 131
    new-instance v4, Lcom/glympse/platform/ProviderSkyhook$MyRegistrationCallback;

    invoke-direct {v4, p0}, Lcom/glympse/platform/ProviderSkyhook$MyRegistrationCallback;-><init>(Lcom/glympse/platform/ProviderSkyhook;)V

    .line 128
    invoke-virtual {v1, v2, v3, v4}, Lcom/skyhookwireless/wps/XPS;->registerUser(Lcom/skyhookwireless/wps/WPSAuthentication;Lcom/skyhookwireless/wps/WPSAuthentication;Lcom/skyhookwireless/wps/RegistrationCallback;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 138
    :goto_0
    return-void

    .line 133
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 135
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    .line 136
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    const/4 v2, 0x1

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Lcom/glympse/platform/LocManager;->IfProviderSetProvider(II)V

    goto :goto_0
.end method

.method private Start3_SignIn(Ljava/lang/String;)V
    .locals 11
    .parameter "strName"

    .prologue
    const/4 v10, 0x0

    .line 143
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v2, "ProviderSkyhook.Start3_SignIn("

    invoke-direct {v0, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v2, ")"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 147
    :try_start_0
    iget-object v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPSAuthentication:Lcom/skyhookwireless/wps/WPSAuthentication;

    if-nez v0, :cond_0

    .line 149
    new-instance v0, Lcom/skyhookwireless/wps/WPSAuthentication;

    const-string v2, "Glympse"

    invoke-direct {v0, p1, v2}, Lcom/skyhookwireless/wps/WPSAuthentication;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    iput-object v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPSAuthentication:Lcom/skyhookwireless/wps/WPSAuthentication;

    .line 153
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v2, Lcom/glympse/platform/Platform;->m_oContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getFilesDir()Ljava/io/File;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v2, "/skyhook"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 156
    .local v1, strPath:Ljava/lang/String;
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z

    .line 159
    iget-object v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPS:Lcom/skyhookwireless/wps/XPS;

    const-wide/32 v2, 0x70800

    const-wide/32 v4, 0x200000

    new-instance v6, Lcom/glympse/platform/ProviderSkyhook$MyTilingListener;

    invoke-direct {v6, p0}, Lcom/glympse/platform/ProviderSkyhook$MyTilingListener;-><init>(Lcom/glympse/platform/ProviderSkyhook;)V

    invoke-virtual/range {v0 .. v6}, Lcom/skyhookwireless/wps/XPS;->setTiling(Ljava/lang/String;JJLcom/skyhookwireless/wps/TilingListener;)V

    .line 161
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fGetPeriodicLocationError:Z

    .line 164
    iget-object v2, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPS:Lcom/skyhookwireless/wps/XPS;

    .line 165
    iget-object v3, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPSAuthentication:Lcom/skyhookwireless/wps/WPSAuthentication;

    .line 166
    sget-object v4, Lcom/skyhookwireless/wps/WPSStreetAddressLookup;->WPS_NO_STREET_ADDRESS_LOOKUP:Lcom/skyhookwireless/wps/WPSStreetAddressLookup;

    .line 167
    const-wide/16 v5, 0x7d0

    const/4 v7, 0x0

    move-object v8, p0

    .line 164
    invoke-virtual/range {v2 .. v8}, Lcom/skyhookwireless/wps/XPS;->getPeriodicLocation(Lcom/skyhookwireless/wps/WPSAuthentication;Lcom/skyhookwireless/wps/WPSStreetAddressLookup;JILcom/skyhookwireless/wps/WPSPeriodicLocationCallback;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 176
    .end local v1           #strPath:Ljava/lang/String;
    :goto_0
    return-void

    .line 171
    :catch_0
    move-exception v0

    move-object v9, v0

    .line 173
    .local v9, e:Ljava/lang/Exception;
    invoke-static {v9}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    .line 174
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    const/4 v2, 0x1

    invoke-virtual {v0, v2, v10}, Lcom/glympse/platform/LocManager;->IfProviderSetProvider(II)V

    goto :goto_0
.end method

.method static synthetic access$0(Lcom/glympse/platform/ProviderSkyhook;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 141
    invoke-direct {p0, p1}, Lcom/glympse/platform/ProviderSkyhook;->Start3_SignIn(Ljava/lang/String;)V

    return-void
.end method


# virtual methods
.method protected CreateLocPoint(Lcom/skyhookwireless/wps/WPSLocation;)Lcom/glympse/platform/common/LocPoint;
    .locals 5
    .parameter "oLocation"

    .prologue
    .line 209
    new-instance v0, Lcom/glympse/platform/common/LocPoint;

    const/4 v1, 0x1

    invoke-direct {v0, v1}, Lcom/glympse/platform/common/LocPoint;-><init>(Z)V

    .line 210
    .local v0, oLocPoint:Lcom/glympse/platform/common/LocPoint;
    const/4 v1, 0x3

    iput v1, v0, Lcom/glympse/platform/common/LocPoint;->m_eLocProvider:I

    .line 211
    invoke-virtual {p1}, Lcom/skyhookwireless/wps/WPSLocation;->getLatitude()D

    move-result-wide v1

    iput-wide v1, v0, Lcom/glympse/platform/common/LocPoint;->m_dLatitude:D

    .line 212
    invoke-virtual {p1}, Lcom/skyhookwireless/wps/WPSLocation;->getLongitude()D

    move-result-wide v1

    iput-wide v1, v0, Lcom/glympse/platform/common/LocPoint;->m_dLongitude:D

    .line 213
    invoke-virtual {p1}, Lcom/skyhookwireless/wps/WPSLocation;->hasAltitude()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-virtual {p1}, Lcom/skyhookwireless/wps/WPSLocation;->getAltitude()D

    move-result-wide v1

    double-to-float v1, v1

    :goto_0
    iput v1, v0, Lcom/glympse/platform/common/LocPoint;->m_fltAltitudeMeters:F

    .line 214
    invoke-virtual {p1}, Lcom/skyhookwireless/wps/WPSLocation;->getBearing()D

    move-result-wide v1

    double-to-float v1, v1

    iput v1, v0, Lcom/glympse/platform/common/LocPoint;->m_fltBearingDegrees:F

    .line 215
    invoke-virtual {p1}, Lcom/skyhookwireless/wps/WPSLocation;->getSpeed()D

    move-result-wide v1

    const-wide v3, 0x3fd1c71c720431f1L

    mul-double/2addr v1, v3

    double-to-float v1, v1

    iput v1, v0, Lcom/glympse/platform/common/LocPoint;->m_fltSpeedMetersPerSecond:F

    .line 216
    invoke-virtual {p1}, Lcom/skyhookwireless/wps/WPSLocation;->getHPE()I

    move-result v1

    int-to-float v1, v1

    iput v1, v0, Lcom/glympse/platform/common/LocPoint;->m_fltAccuracyMeters:F

    .line 217
    invoke-virtual {p1}, Lcom/skyhookwireless/wps/WPSLocation;->getTime()J

    move-result-wide v1

    iput-wide v1, v0, Lcom/glympse/platform/common/LocPoint;->m_lLocationTime:J

    .line 218
    return-object v0

    .line 213
    :cond_0
    const/high16 v1, 0x7fc0

    goto :goto_0
.end method

.method public DoUpdate(I)V
    .locals 2
    .parameter "updateFlags"

    .prologue
    .line 226
    iget-boolean v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fRunning:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    iget v1, v1, Lcom/glympse/platform/LocManager;->m_eLocProvider:I

    if-ne v0, v1, :cond_0

    .line 227
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    invoke-virtual {v0}, Lcom/glympse/platform/Config;->GetGlympseUserId()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 229
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    invoke-virtual {v0}, Lcom/glympse/platform/Config;->GetGlympseUserId()Ljava/lang/String;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/glympse/platform/ProviderSkyhook;->Start2_CreateAccount(Ljava/lang/String;)V

    .line 232
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    invoke-virtual {v0, p0}, Lcom/glympse/platform/Platform;->RemoveGlympseListener(Lcom/glympse/platform/common/GlympseListener;)V

    .line 233
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fGlympseListener:Z

    .line 235
    :cond_0
    return-void
.end method

.method protected Start()Z
    .locals 3

    .prologue
    .line 71
    iget-boolean v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fRunning:Z

    if-nez v1, :cond_1

    .line 75
    :try_start_0
    const-string v1, "Starting Skyhook Listener"

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 77
    iget-object v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPS:Lcom/skyhookwireless/wps/XPS;

    if-nez v1, :cond_0

    .line 80
    new-instance v1, Lcom/skyhookwireless/wps/XPS;

    sget-object v2, Lcom/glympse/platform/Platform;->m_oContext:Landroid/content/Context;

    invoke-direct {v1, v2}, Lcom/skyhookwireless/wps/XPS;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPS:Lcom/skyhookwireless/wps/XPS;

    .line 84
    :cond_0
    const/4 v1, 0x1

    iput-boolean v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fRunning:Z

    .line 87
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-object v1, v1, Lcom/glympse/platform/Config;->m_strSkyhookName:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_2

    .line 89
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-object v1, v1, Lcom/glympse/platform/Config;->m_strSkyhookName:Ljava/lang/String;

    invoke-direct {p0, v1}, Lcom/glympse/platform/ProviderSkyhook;->Start3_SignIn(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 116
    :cond_1
    :goto_0
    iget-boolean v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fRunning:Z

    return v1

    .line 94
    :cond_2
    :try_start_1
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    invoke-virtual {v1}, Lcom/glympse/platform/Config;->GetGlympseUserId()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_3

    .line 96
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    invoke-virtual {v1}, Lcom/glympse/platform/Config;->GetGlympseUserId()Ljava/lang/String;

    move-result-object v1

    invoke-direct {p0, v1}, Lcom/glympse/platform/ProviderSkyhook;->Start2_CreateAccount(Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    .line 109
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 111
    .local v0, e:Ljava/lang/Exception;
    const/4 v1, 0x0

    iput-boolean v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fRunning:Z

    .line 112
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0

    .line 105
    .end local v0           #e:Ljava/lang/Exception;
    :cond_3
    const/4 v1, 0x1

    :try_start_2
    iput-boolean v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fGlympseListener:Z

    .line 106
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    invoke-virtual {v1, p0}, Lcom/glympse/platform/Platform;->AddGlympseListener(Lcom/glympse/platform/common/GlympseListener;)V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_0
.end method

.method public Stop()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 181
    iput-boolean v2, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fRunning:Z

    .line 184
    iget-boolean v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fGlympseListener:Z

    if-eqz v1, :cond_0

    .line 186
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    invoke-virtual {v1, p0}, Lcom/glympse/platform/Platform;->RemoveGlympseListener(Lcom/glympse/platform/common/GlympseListener;)V

    .line 187
    iput-boolean v2, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fGlympseListener:Z

    .line 191
    :cond_0
    iget-object v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPS:Lcom/skyhookwireless/wps/XPS;

    if-eqz v1, :cond_1

    .line 193
    const-string v1, "Stopping Skyhook Provider"

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 196
    :try_start_0
    iget-object v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPS:Lcom/skyhookwireless/wps/XPS;

    invoke-virtual {v1}, Lcom/skyhookwireless/wps/XPS;->abort()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 202
    :goto_0
    const/4 v1, 0x0

    iput-object v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_oWPS:Lcom/skyhookwireless/wps/XPS;

    .line 204
    :cond_1
    return-void

    .line 198
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 200
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method public done()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 265
    const-string v0, "WPSPeriodicLocationCallback.done"

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 268
    iget-boolean v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fGetPeriodicLocationError:Z

    if-eqz v0, :cond_0

    .line 270
    iput-boolean v2, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fGetPeriodicLocationError:Z

    .line 271
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    const/4 v1, 0x1

    invoke-virtual {v0, v1, v2}, Lcom/glympse/platform/LocManager;->IfProviderSetProvider(II)V

    .line 273
    :cond_0
    return-void
.end method

.method public handleError(Lcom/skyhookwireless/wps/WPSReturnCode;)Lcom/skyhookwireless/wps/WPSContinuation;
    .locals 3
    .parameter "eError"

    .prologue
    const/4 v2, 0x1

    .line 279
    sget-object v0, Lcom/skyhookwireless/wps/WPSReturnCode;->WPS_ERROR_NO_WIFI_IN_RANGE:Lcom/skyhookwireless/wps/WPSReturnCode;

    if-eq v0, p1, :cond_0

    .line 281
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "WPSPeriodicLocationCallback.handleError("

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ")"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 285
    :cond_0
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    iget v0, v0, Lcom/glympse/platform/LocManager;->m_eLocProvider:I

    if-ne v2, v0, :cond_1

    .line 286
    sget-object v0, Lcom/skyhookwireless/wps/WPSReturnCode;->WPS_ERROR_UNAUTHORIZED:Lcom/skyhookwireless/wps/WPSReturnCode;

    if-ne v0, p1, :cond_1

    .line 288
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    const/4 v1, 0x0

    invoke-virtual {v0, v2, v1}, Lcom/glympse/platform/LocManager;->IfProviderSetProvider(II)V

    .line 292
    :cond_1
    sget-object v0, Lcom/skyhookwireless/wps/WPSReturnCode;->WPS_ERROR:Lcom/skyhookwireless/wps/WPSReturnCode;

    if-ne v0, p1, :cond_2

    .line 294
    iput-boolean v2, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fGetPeriodicLocationError:Z

    .line 297
    :cond_2
    iget-boolean v0, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fRunning:Z

    if-eqz v0, :cond_3

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    iget v0, v0, Lcom/glympse/platform/LocManager;->m_eLocProvider:I

    if-ne v2, v0, :cond_3

    .line 298
    sget-object v0, Lcom/skyhookwireless/wps/WPSContinuation;->WPS_CONTINUE:Lcom/skyhookwireless/wps/WPSContinuation;

    .line 297
    :goto_0
    return-object v0

    .line 298
    :cond_3
    sget-object v0, Lcom/skyhookwireless/wps/WPSContinuation;->WPS_STOP:Lcom/skyhookwireless/wps/WPSContinuation;

    goto :goto_0
.end method

.method public handleWPSPeriodicLocation(Lcom/skyhookwireless/wps/WPSLocation;)Lcom/skyhookwireless/wps/WPSContinuation;
    .locals 3
    .parameter "oLocation"

    .prologue
    .line 246
    if-eqz p1, :cond_0

    .line 250
    :try_start_0
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v1, v1, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    invoke-virtual {p0, p1}, Lcom/glympse/platform/ProviderSkyhook;->CreateLocPoint(Lcom/skyhookwireless/wps/WPSLocation;)Lcom/glympse/platform/common/LocPoint;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/glympse/platform/LocManager;->AddLocation(Lcom/glympse/platform/common/LocPoint;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 258
    :cond_0
    :goto_0
    iget-boolean v1, p0, Lcom/glympse/platform/ProviderSkyhook;->m_fRunning:Z

    if-eqz v1, :cond_1

    const/4 v1, 0x1

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    iget v2, v2, Lcom/glympse/platform/LocManager;->m_eLocProvider:I

    if-ne v1, v2, :cond_1

    sget-object v1, Lcom/skyhookwireless/wps/WPSContinuation;->WPS_CONTINUE:Lcom/skyhookwireless/wps/WPSContinuation;

    :goto_1
    return-object v1

    .line 252
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 254
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0

    .line 258
    .end local v0           #e:Ljava/lang/Exception;
    :cond_1
    sget-object v1, Lcom/skyhookwireless/wps/WPSContinuation;->WPS_STOP:Lcom/skyhookwireless/wps/WPSContinuation;

    goto :goto_1
.end method
